import dayjs from "dayjs";

export default function (app){
    app.directive("format-time",{
        mounted(el){
            const textCountent = el.textContent;
            let timestamp = parseInt(textCountent);
            if (textCountent.length === 10){
                timestamp = timestamp*10
            }
            el.textContent = dayjs(timestamp).format("YYYY-MM-dd hh:mm:ss");
        }
    })
}